//
//  ClientMessage.swift
//  uwantgoeasy
//
//  Created by 冯传宝 on 12/11/15.
//  Copyright © 2015 uwantsoft. All rights reserved.
//

import Foundation
class ClientMessage {
    var sid:String = ""
    var executorNumber:Int = -1
    var guid:String = NSUUID().UUIDString
    var retried:UInt32 = 0
    
    init(sid: String){
        self.sid = sid
    }
    
    func typeCode()->Int{
        return 0
    }
    
    func jsonAsString()->String{
        let dict = Mirror(reflecting: self).toDictionary()
        return GoEasyJsonUtils.dictAsJsonString(dict)
    }
    
    func setRetried(retried: UInt32){
        self.retried = retried
    }
}